﻿using Admin.NET.Core;
using MOKA.TPM.Entity;
using System.ComponentModel.DataAnnotations;

namespace MOKA.TPM.Service.Dto;

/// <summary>
/// 页面输出参数 （资产）
/// </summary>
public class AssetOutput : Asset
{
    /// <summary>
    /// TPM设备分组（MES） （字典或人员名称）
    /// </summary>
    public string? TPMDeviceGroupName { get; set; }

    /// <summary>
    /// 使用部门（MES） （字典或人员名称）
    /// </summary>
    public string? UserDepartmentName { get; set; }

    /// <summary>
    /// 创建用户 （字典或人员名称）
    /// </summary>
    public string? CreateUserName { get; set; }

    /// <summary>
    /// 更新用户 （字典或人员名称）
    /// </summary>
    public string? UpdateUserName { get; set; }

    public string CompanyCode { get; set; }  //唯一索引

    public string AssetNo { get; set; }  //唯一索引
}

/// <summary>
/// 单ID查询参数
/// </summary>
public class AssetInput
{
    /// <summary>
    /// 序号
    /// </summary>
    public Guid? Id { get; set; }
}

/// <summary>
/// 普通查询参数
/// </summary>
public class GetAssetInput : BaseOrderInput
{
    /// <summary>
    /// 公司代码
    /// </summary>
    public string? CompanyCode { get; set; }  //唯一索引

    /// <summary>
    /// 资产编号
    /// </summary>
    public string? AssetNo { get; set; }  //唯一索引
}

/// <summary>
/// 分页查询参数
/// </summary>
public class PageAssetInput : BasePageInput
{
    /// <summary>
    /// 公司代码
    /// </summary>
    public string? CompanyCode { get; set; }  //唯一索引

    /// <summary>
    /// 资产编号
    /// </summary>
    public string? AssetNo { get; set; }  //唯一索引
}

/// <summary>
/// 新增记录参数
/// </summary>
public class AddAssetInput
{
    /// <summary>
    /// 资产编号
    /// </summary>
    [Required, MaxLength(50)]
    public string AssetNo { get; set; } = string.Empty;

    /// <summary>
    /// 资产名称
    /// </summary>
    [Required, MaxLength(50)]
    public string AssetName { get; set; } = string.Empty;

    /// <summary>
    /// 公司代码
    /// </summary>
    [Required, MaxLength(50)]
    public string CompanyCode { get; set; } = string.Empty;

    /// <summary>
    /// 公司名称
    /// </summary>
    [Required, MaxLength(50)]
    public string CompanyName { get; set; } = string.Empty;

    /// <summary>
    /// TPM设备分组（MES）
    /// </summary>
    public Guid TPMDeviceGroupId { get; set; }

    /// <summary>
    /// 资产大类代码
    /// </summary>
    [Required, MaxLength(50)]
    public string CategoryCode { get; set; } = string.Empty;

    /// <summary>
    /// 资产大类名称
    /// </summary>
    [Required, MaxLength(50)]
    public string CategoryName { get; set; } = string.Empty;

    /// <summary>
    /// 资产细类代码
    /// </summary>
    [Required, MaxLength(50)]
    public string TypeCode { get; set; } = string.Empty;

    /// <summary>
    /// 资产细类名称
    /// </summary>
    [Required, MaxLength(50)]
    public string TypeName { get; set; } = string.Empty;

    /// <summary>
    /// 型号
    /// </summary>
    [Required, MaxLength(50)]
    public string Model { get; set; } = string.Empty;

    /// <summary>
    /// 资产状态
    /// </summary>
    [Required, MaxLength(20)]
    public string Status { get; set; } = string.Empty;

    /// <summary>
    /// 资本化日期
    /// </summary>
    public DateTime? CapitalizationDate { get; set; }

    /// <summary>
    /// 报废日期
    /// </summary>
    public DateTime? ScrapDate { get; set; }

    /// <summary>
    /// 供应商代码
    /// </summary>
    [Required, MaxLength(50)]
    public string SupplierCode { get; set; } = string.Empty;

    /// <summary>
    /// 供应商名称
    /// </summary>
    [Required, MaxLength(50)]
    public string SupplierName { get; set; } = string.Empty;

    /// <summary>
    /// 成本中心代码
    /// </summary>
    [Required, MaxLength(50)]
    public string CostCenterCode { get; set; } = string.Empty;

    /// <summary>
    /// 成本中心名称
    /// </summary>
    [Required, MaxLength(50)]
    public string CostCenterName { get; set; } = string.Empty;

    /// <summary>
    /// 一级部门
    /// </summary>
    [MaxLength(50)]
    public string? DepartmentLv1 { get; set; }

    /// <summary>
    /// 二级部门
    /// </summary>
    [MaxLength(50)]
    public string? DepartmentLv2 { get; set; }

    /// <summary>
    /// 使用部门（MES）
    /// </summary>
    [MaxLength(50)]
    public string? UserDepartmentID { get; set; }

    /// <summary>
    /// 资产管理员工号
    /// </summary>
    [Required, MaxLength(50)]
    public string ManagerNo { get; set; } = string.Empty;

    /// <summary>
    /// 资产管理员姓名
    /// </summary>
    [Required, MaxLength(50)]
    public string ManagerName { get; set; } = string.Empty;

    /// <summary>
    /// 资产使用人工号
    /// </summary>
    [Required, MaxLength(50)]
    public string UserNo { get; set; } = string.Empty;

    /// <summary>
    /// 资产使用人姓名
    /// </summary>
    [Required, MaxLength(50)]
    public string UserName { get; set; } = string.Empty;

    /// <summary>
    /// 资产使用人工号（MES）
    /// </summary>
    [Required, MaxLength(50)]
    public string UserNo_MES { get; set; } = string.Empty;

    /// <summary>
    /// 资产使用人姓名（MES）
    /// </summary>
    [Required, MaxLength(50)]
    public string UserName_MES { get; set; } = string.Empty;

    /// <summary>
    /// 库存地点
    /// </summary>
    [Required, MaxLength(100)]
    public string Position { get; set; } = string.Empty;

    /// <summary>
    /// 库存地点（MES）
    /// </summary>
    [Required, MaxLength(100)]
    public string Position_MES { get; set; } = string.Empty;

    /// <summary>
    /// 数量
    /// </summary>
    public int Qty { get; set; }

    /// <summary>
    /// 图片（MES）
    /// </summary>
    public byte[] Picture { get; set; }

    /// <summary>
    /// 备注
    /// </summary>
    [MaxLength(100)]
    public string? Remark { get; set; }

    /// <summary>
    /// SAP创建时间
    /// </summary>
    public DateTime? CreateTimeInSAP { get; set; }

    /// <summary>
    /// SAP更新时间
    /// </summary>
    public DateTime? UpdateTimeInSAP { get; set; }

    /// <summary>
    /// SAP同步时间
    /// </summary>
    public DateTime? SyncTime { get; set; }

    /// <summary>
    /// 创建用户
    /// </summary>
    [Required, MaxLength(20)]
    public string CreateUser { get; set; } = string.Empty;

    /// <summary>
    /// 创建时间
    /// </summary>
    public DateTime CreateTime { get; set; }

    /// <summary>
    /// 更新用户
    /// </summary>
    [MaxLength(20)]
    public string? UpdateUser { get; set; }

    /// <summary>
    /// 更新时间
    /// </summary>
    public DateTime? UpdateTime { get; set; }
}

/// <summary>
/// 更新参数
/// </summary>
public class UpdateAssetInput
{
    /// <summary>
    /// 序号
    /// </summary>
    public Guid Id { get; set; }

    /// <summary>
    /// 资产编号
    /// </summary>
    [MaxLength(50)]
    public string AssetNo { get; set; }

    /// <summary>
    /// 资产名称
    /// </summary>
    [MaxLength(50)]
    public string AssetName { get; set; }

    /// <summary>
    /// 公司代码
    /// </summary>
    [MaxLength(50)]
    public string CompanyCode { get; set; }

    /// <summary>
    /// 公司名称
    /// </summary>
    [MaxLength(50)]
    public string CompanyName { get; set; }

    /// <summary>
    /// TPM设备分组（MES）
    /// </summary>
    public Guid TPMDeviceGroupId { get; set; }

    /// <summary>
    /// 资产大类代码
    /// </summary>
    [MaxLength(50)]
    public string CategoryCode { get; set; }

    /// <summary>
    /// 资产大类名称
    /// </summary>
    [MaxLength(50)]
    public string CategoryName { get; set; }

    /// <summary>
    /// 资产细类代码
    /// </summary>
    [MaxLength(50)]
    public string TypeCode { get; set; }

    /// <summary>
    /// 资产细类名称
    /// </summary>
    [MaxLength(50)]
    public string TypeName { get; set; }

    /// <summary>
    /// 型号
    /// </summary>
    [MaxLength(50)]
    public string Model { get; set; }

    /// <summary>
    /// 资产状态
    /// </summary>
    [MaxLength(20)]
    public string Status { get; set; }

    /// <summary>
    /// 资本化日期
    /// </summary>
    public DateTime? CapitalizationDate { get; set; }

    /// <summary>
    /// 报废日期
    /// </summary>
    public DateTime? ScrapDate { get; set; }

    /// <summary>
    /// 供应商代码
    /// </summary>
    [MaxLength(50)]
    public string SupplierCode { get; set; }

    /// <summary>
    /// 供应商名称
    /// </summary>
    [MaxLength(50)]
    public string SupplierName { get; set; }

    /// <summary>
    /// 成本中心代码
    /// </summary>
    [MaxLength(50)]
    public string CostCenterCode { get; set; }

    /// <summary>
    /// 成本中心名称
    /// </summary>
    [MaxLength(50)]
    public string CostCenterName { get; set; }

    /// <summary>
    /// 一级部门
    /// </summary>
    [MaxLength(50)]
    public string? DepartmentLv1 { get; set; }

    /// <summary>
    /// 二级部门
    /// </summary>
    [MaxLength(50)]
    public string? DepartmentLv2 { get; set; }

    /// <summary>
    /// 使用部门（MES）
    /// </summary>
    [MaxLength(50)]
    public string? UserDepartmentID { get; set; }

    /// <summary>
    /// 资产管理员工号
    /// </summary>
    [MaxLength(50)]
    public string ManagerNo { get; set; }

    /// <summary>
    /// 资产管理员姓名
    /// </summary>
    [MaxLength(50)]
    public string ManagerName { get; set; }

    /// <summary>
    /// 资产使用人工号
    /// </summary>
    [MaxLength(50)]
    public string UserNo { get; set; }

    /// <summary>
    /// 资产使用人姓名
    /// </summary>
    [MaxLength(50)]
    public string UserName { get; set; }

    /// <summary>
    /// 资产使用人工号（MES）
    /// </summary>
    [MaxLength(50)]
    public string UserNo_MES { get; set; }

    /// <summary>
    /// 资产使用人姓名（MES）
    /// </summary>
    [MaxLength(50)]
    public string UserName_MES { get; set; }

    /// <summary>
    /// 库存地点
    /// </summary>
    [MaxLength(100)]
    public string Position { get; set; }

    /// <summary>
    /// 库存地点（MES）
    /// </summary>
    [MaxLength(100)]
    public string Position_MES { get; set; }

    /// <summary>
    /// 数量
    /// </summary>
    public int Qty { get; set; }

    /// <summary>
    /// 图片（MES）
    /// </summary>
    public byte[] Picture { get; set; }

    /// <summary>
    /// 备注
    /// </summary>
    [MaxLength(100)]
    public string? Remark { get; set; }

    /// <summary>
    /// SAP创建时间
    /// </summary>
    public DateTime? CreateTimeInSAP { get; set; }

    /// <summary>
    /// SAP更新时间
    /// </summary>
    public DateTime? UpdateTimeInSAP { get; set; }

    /// <summary>
    /// SAP同步时间
    /// </summary>
    public DateTime? SyncTime { get; set; }

    /// <summary>
    /// 创建用户
    /// </summary>
    [MaxLength(20)]
    public string CreateUser { get; set; }

    /// <summary>
    /// 创建时间
    /// </summary>
    public DateTime CreateTime { get; set; }

    /// <summary>
    /// 更新用户
    /// </summary>
    [MaxLength(20)]
    public string? UpdateUser { get; set; }

    /// <summary>
    /// 更新时间
    /// </summary>
    public DateTime? UpdateTime { get; set; }
}

/// <summary>
/// 删除参数
/// </summary>
public class DeleteAssetInput
{
    /// <summary>
    /// 序号
    /// </summary>
    public Guid Id { get; set; }
}

/// <summary>
/// 更新部分数据参数
/// </summary>
public class UpdateSomeAssetInput
{
    /// <summary>
    /// 序号
    /// </summary>
    public Guid Id { get; set; }

    /// <summary>
    /// 公司代码
    /// </summary>
    public string? CompanyCode { get; set; }  //唯一索引

    /// <summary>
    /// 资产编号
    /// </summary>
    public string? AssetNo { get; set; }  //唯一索引
}